package com.example.gzysmartcity.ui.adapter;

import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.example.gzysmartcity.R;

import org.jetbrains.annotations.NotNull;

public class CommitImageAdapter extends BaseQuickAdapter<String, BaseViewHolder> {
    public CommitImageAdapter(int layoutResId) {
        super(layoutResId);
    }

    @Override
    protected void convert(@NotNull BaseViewHolder baseViewHolder, String s) {
        ImageView imageView = baseViewHolder.getView(R.id.rv_commit_image);
        if (s.equals("")) {
            Glide.with(getContext()).load(R.drawable.tianjia).error(R.drawable.error).into(imageView);
            return;
        }
        Glide.with(getContext()).load(s).error(R.drawable.error).into(imageView);
    }
}